#import <SpringBoard/SBLowPowerAlertItem.h>
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import "substrate.h"

static BOOL GPowerAlertKiller_SBLowPowerAlertItem__shouldIgnoreChangeToBatteryLevel(SBLowPowerAlertItem *self, SEL _cmd, unsigned _battLevel) {
	return YES;
}

extern "C" void GPowerAlertKiller() {
	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

	Class _SpringBoard = objc_getClass("SpringBoard");
	Class _SBLowPowerAlertItem = objc_getClass("SBLowPowerAlertItem");
	if(_SpringBoard == nil || _SBLowPowerAlertItem == nil) return;

	MSHookMessage(_SBLowPowerAlertItem, @selector(_shouldIgnoreChangeToBatteryLevel:), (IMP)GPowerAlertKiller_SBLowPowerAlertItem__shouldIgnoreChangeToBatteryLevel, "GPAK_");

	[pool release];
}
